@extends('Admin.layouts.common')

@section('content')
    <div class="container">
        <div id="order_tag"></div>
        <a href="/config/add_channel"><button  class="btn btn-info">添加渠道</button></a>
        <div class="table-responsive">
            <table class="table">
                <caption>推广渠道列表</caption>
                <thead>
                    <tr>
                        <th><a href="javascript:void(0);" data-order="channel_id">渠道id</a></th>
                        <th><a href="javascript:void(0);" data-order="channel_no">渠道编号</a></th>
                        <th><a href="javascript:void(0);" data-order="channel_name">渠道名称</a></th>
                        <th><a href="javascript:void(0);" data-order="add_time">添加时间</a></th>
                        <th><a href="javascript:void(0);" data-order="channel_status">状态</a></th>

                         <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    @forelse($list->items() as $item)
                        <tr <?php if($item->channel_status==0):?>class="danger"<?php endif;?>>
                            <td>{{ $item->channel_id }}</td>
                            <td>{{ $item->channel_no }}</td>
                            <td>{{ $item->channel_name }}</td>
                            <td>{{ $item->add_time }}</td>
                            <td><a href="/config/change_channel_status/{{ $item->channel_id }}?status={{$item->channel_status}}">{{ $item->channel_status==1?'启用':'禁用'}}</a></td>
                            <td>
                                <a href="/config/edit_channel/{{ $item->channel_id }}">编辑</a>
                                <a href="/config/remove_channel/{{ $item->channel_id }}">删除</a>
                            </td> 
                        </tr>
                    @empty
                        <tr><td class="text-center" colspan="8">没有数据</td></tr>
                    @endforelse
                </tbody>
            </table>
            <div class="text-center">
                {{ $list->links() }}
            </div>
        </div>

    </div>
@endsection